package com.dadaguai.mapper;

import com.dadaguai.domain.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 王半仙
 * @description 针对表【user_info(用户信息)】的数据库操作Mapper
 * @createDate 2023-10-20 11:28:40
 * @Entity com.dadaguai.domain.UserInfo
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Update("update user_info " +
            "set current_integral = #{current}," +
            "total_integral = #{total} " +
            "where user_id = #{id}")
    void updateUserIntegral(@Param("current") Integer current, @Param("total") Integer total, @Param("id") String id);

    @Select("select * from user_info where email = #{email}")
    UserInfo selectByEmail(@Param("email") String email);

    @Update("update user_info " +
            "set password = #{password} " +
            "where email = #{email}")
    Integer updatePassword(@Param("email") String email, @Param("password") String password);
}




